package com.yami.shop.bean.enums;

public enum TradeType {

    /**
     * 交易类型      1：下单买入 2：空投 3：转赠 4：合成减少 5：合成增加 6：寄售 7：寄售取消 8：寄售买入 9：转出 10：转入 11：兑换
     */
    UNKNOWN(0, "未知类型"),

    PLACE_ORDER(1, "下单买入"),

    AIRDROP(2, "空投"),

    RE_GIFT(3, "转赠"),

    SYNTHESIS_DEL(4, "合成减少"),

    SYNTHESIS_ADD(5, "合成增加"),

    CONSIGN(6, "寄售"),

    CONSIGN_CANCEL(7, "寄售取消"),

    CONSIGN_BUY(8, "寄售买入"),

    ROLL_OUT(9, "转出"),

    ROLL_IN(10, "转入"),

    EXCHANGE(11, "兑换"),

    OPEN_HOLD(12, "开启盲盒"),

    RED_ENVELOPE(13, "红包"),

    PLACE_ZERO(14, "零元购"),

    ROLL_IN_AIRDROP(15, "提现空投"),

    PLACE_MAll_ORDER(16, "商城买入"),

    SHARE_ENVELOPE(17, "分享"),
    ;

    private Integer value;

    private String info;

    TradeType(Integer value, String info) {
        this.value = value;
        this.info = info;
    }

    public Integer getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }

    public static TradeType instance(Integer value){
        TradeType[] values = values();
        for (TradeType tradeType : values) {
            if (tradeType.value.equals(value)) {
                return tradeType;
            }
        }
        return UNKNOWN;
    }

}
